<?php
namespace Admin\Controller;
use Think\Controller;
class BaseController extends Controller {
	
	//基本配置
    public function index(){

        /*$data = M('base')->find();
        $this->assign('data',$data);
        $this->display();*/
        $this->display();
    }

    //修改配置
    public function edit(){
        //判断是否post提交
        if(IS_POST){
            //接收参数
            $_data = I('post.');
            //修改数据库
            $res = M('base')->save($_data);
            //判断是否成功
            if($res > 0){
                $this->success('修改成功',U('Base/index'));
            }else{
                $this->error('修改失败');
            }
        }else{
            //提取数据
            $data = M('base')->find();

            $this->assign('data',$data);
            $this->display();
        }

    }

}